package com.bensonbasement.snorflux.utils;

public enum Direction {
	
	NORTH("north","N",0,-1,2),
	SOUTH("south","S",0,1,2,NORTH),
	EAST("east","E",1,0,2),
	WEST("west","W",-1,0,2,EAST),
	NORTHEAST("northeast","NE",1,-1,3),
	SOUTHWEST("southwest","SW",-1,1,3,NORTHEAST),
	NORTHWEST("northwest","NW",-1,-1,3),
	SOUTHEAST("southeast","SE",1,1,3,NORTHWEST);
	
	private final String longName;
	private final String shortName;
	private final int xOffset;
	private final int yOffset;
	private final int baseCost;
	private Direction oppositeDir = null;
	
	private Direction(String longName, String shortName, int xOffset, int yOffset, int baseCost) {
		this.longName = longName;
		this.shortName = shortName;
		this.xOffset = xOffset;
		this.yOffset = yOffset;
		this.baseCost = baseCost;
	}
	
	private Direction(String longName, String shortName, int xOffset, int yOffset, int baseCost, Direction oppositeDir) {
		this(longName,shortName,xOffset,yOffset,baseCost);
		this.oppositeDir = oppositeDir;
		oppositeDir.oppositeDir = this;
	}

	public String getLongName() {
		return longName;
	}

	public String getShortName() {
		return shortName;
	}

	public int getXOffset() {
		return xOffset;
	}

	public int getYOffset() {
		return yOffset;
	}

	public int getBaseCost() {
		return baseCost;
	}

	public Direction getOppositeDir() {
		return oppositeDir;
	}
	
	public Coords getCoords() {
		return new Coords(this.xOffset,this.yOffset);
	}
	
}
